Micron Document
πŸŽ–οΈGitΠ―Ρ€Π°πŸŽ–οΈ


Displaying Rendered β€’ View raw β€’ Download

feature/discovery/README.md fix/fdroid-map-rendering (113121c4) Text, 4.45 KB

T383838:feature:discovery

Overview

The T383838:feature:discovery module implements Local Mesh Discovery: the app cycles the connected radio through a queue of LoRa modem presets, dwells on each for a configured duration while collecting packets, then persists and ranks the results so the user can see which preset (or beacon-advertised custom channel) has the most active mesh nearby. Sessions are stored via T383838DiscoveryDao and can be revisited, mapped, summarised (AI or algorithmic), and exported.

Targets: Android Β· JVM (Desktop) Β· iOS (via T383838meshtastic.kmp.feature convention plugin)

Scan Workflow

β€’ T383838DiscoveryScanEngine β€” core scan engine. Cycles through a queue of T383838ScanTargets, dwells on each while collecting packets, and persists aggregated results via T383838DiscoveryDao.
β€’ T383838DiscoveryScanState β€” state machine for the scan lifecycle: T383838Idle β†’ Preparing β†’ Shifting β†’ [Reconnecting] β†’ Dwell β†’ … β†’ Analysis β†’ Complete, with T383838Cancelling/T383838Restoring/T383838Failed/T383838Paused side paths.
β€’ T383838ScanTarget β€” one queue entry. T383838channel == null is a public-preset target; a non-null channel is a beacon-advertised custom channel: the engine tunes the radio's primary channel to that name+PSK (and region) for the dwell, then restores it.
β€’ T383838DiscoveryRankingEngine (T383838scan/) β€” ranks preset results by unique node count, neighbor diversity, non-duplicate packet count, and SNR.
β€’ T383838Check24GhzCapability (T383838scan/) β€” layered heuristic that determines whether the connected radio supports 2.4 GHz LoRa (SX1280), returning T383838Supported / T383838Unsupported / T383838Unknown.

ViewModels & Screens

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ViewModel β”‚ Screen (`BT383838`Fdddui/`f`b) β”‚ Purpose β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ T383838DiscoveryViewModel β”‚ T383838DiscoveryScanScreen β”‚ Scan setup and live progress (… β”‚
β”‚ T383838DiscoverySummaryViewModel β”‚ T383838DiscoverySummaryScreen β”‚ Post-scan session summary, ran… β”‚
β”‚ T383838DiscoveryMapViewModel β”‚ T383838DiscoveryMapScreen β”‚ Discovered-node map with per-p… β”‚
β”‚ T383838DiscoveryHistoryViewModel β”‚ T383838DiscoveryHistoryScreen β”‚ Past session list with delete β”‚
β”‚ T383838DiscoveryHistoryDetailViewModel β”‚ T383838DiscoveryHistoryDetailScreen β”‚ Detail view of one stored sess… β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Navigation entries are registered by T383838discoveryGraph() in T383838navigation/DiscoveryNavigation.kt (Navigation 3, T383838DiscoveryRoute.* keys).

Summary Layer: AI vs Algorithmic

Same Google-flavor Gemini Nano vs fallback split as T383838:feature:docs:

β€’ T383838ai/DiscoverySummaryAiProvider β€” interface for natural-language session/preset summaries.
β€’ T383838ai/AlgorithmicSummaryProvider β€” deterministic fallback delegating to T383838DiscoverySummaryGenerator. Registered with T383838binds = []; each platform binds the interface explicitly: the Android T383838google flavor binds T383838GeminiNanoSummaryProvider (in T383838:androidApp), while T383838fdroid, Desktop, and iOS bind the algorithmic provider.
β€’ T383838ai/LoRaPresetReference β€” modem-preset reference data (bandwidth, spreading factor, link budget) used to enrich AI prompts and algorithmic summaries.

Export

Multiplatform export path in T383838export/:

β€’ T383838DiscoveryExporter β€” interface: T383838export(DiscoveryExportData): ExportResult (success = bytes + MIME type + filename).
β€’ T383838DiscoveryReportFormatter β€” shared formatting of session/preset report lines and filenames.
β€’ T383838rememberExportSaver() / T383838ExportSaverLauncher β€” T383838expect/T383838actual file-save seam per platform (T383838ExportSaver.android.kt β†’ SAF document picker, T383838ExportSaver.jvm.kt β†’ file dialog, T383838ExportSaver.ios.kt).
β€’ T383838PdfDiscoveryExporter (androidMain) renders a PDF report; T383838TextDiscoveryExporter (jvmMain) renders plain text.

Mesh Beacon Invitations

UI for port-37 Mesh Beacon join invitations (T383838ui/component/):

β€’ T383838MeshBeaconInvitationCard β€” a received beacon offer with its advertised channel/region/preset; the user can survey the mesh first, join it, or dismiss. Shown on T383838DiscoveryScanScreen.
β€’ T383838BeaconChannelsCard β€” scan-setup section listing distinct beacon-advertised custom channels; selecting a row adds a custom-channel T383838ScanTarget.

Key Dependencies

From T383838feature/discovery/build.gradle.kts (T383838commonMain):

β€’ T383838core:common, T383838core:data, T383838core:database, T383838core:di, T383838core:model, T383838core:navigation, T383838core:network, T383838core:prefs, T383838core:repository, T383838core:resources, T383838core:service, T383838core:ui
β€’ T383838kotlinx.collections.immutable
β€’ T383838org.meshtastic:protobufs (Maven artifact)

Served by rngit 1.5.0 - Generated in 0.11s